<?php

namespace app\models;

use Yii;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
/**
 * This is the model class for table "sign".
 *
 * @property integer $signid
 * @property double $take_money
 * @property integer $continuity
 * @property integer $user_id
 * @property integer $created_at
 * @property integer $updated_at
 */
class Sign extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'sign';
    }

    public function behaviors()
    {
        return [
            [
                'class' => TimestampBehavior::className(),
                'attributes'=>[
                    ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'],
                    ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
                ],
            ]
        ];
    }
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['take_money', 'continuity', 'user_id'], 'required'],
            [['take_money'], 'number'],
            [['continuity', 'user_id'], 'integer'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'signid' => 'ID',
            'take_money' => '赠币',
            'continuity' => '连续',
            'user_id' => '用户id',
            'created_at' => '创建时间',
            'updated_at' => '修改时间',
        ];
    }
}
